using System;
using System.Collections.Generic;
using System.Text;

namespace LogParser.DA
{
    class TeamListModel
    {

        #region Private Member Variables

        private DA.DataObjects.TeamsDSTableAdapters.TeamsTableAdapter tta;

        #endregion

        #region Public Member Variables
        #endregion

        #region Constructor

        public TeamListModel( )
        {
            Initialize();
        }

        private void Initialize( )
        {
            tta = TableAdapters.TeamsTableAdapter();
        }


        #endregion

        #region Public Properties
        #endregion

        #region Private Properties
        #endregion

        #region Public Methods

        public List<GameObjects.Team> GetTeamsList( )
        {

            List<GameObjects.Team> returnList = new List<LogParser.GameObjects.Team>();

            DA.DataObjects.TeamsDS.TeamsDataTable tdt = tta.GetData();

            foreach ( DA.DataObjects.TeamsDS.TeamsRow tr in tdt.Rows )
            {
                GameObjects.Team tempTeam = new LogParser.GameObjects.Team();
                tempTeam.Name = tr.TeamShortName;
                tempTeam.FullName = tr.TeamFullName;
                tempTeam.ID = tr.TeamID;

                returnList.Add( tempTeam );
            }

            return returnList;

        }

        #endregion

        #region Private Methods
        #endregion

    }
}
